package cn.jdx.listener;

import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

public class MyListener implements HttpSessionListener { //(1).实现 HttpSessionListener 接口
    public static int online =0 ;
    @Override
    public void sessionCreated(HttpSessionEvent se) {
        //(2).重写其中的方法
        System.out.println("[监听器]:sessionCreated()");
        online++;
    }

    @Override
    public void sessionDestroyed(HttpSessionEvent se) {
        System.out.println("[监听器]:sessionDestroyed()");
    }
}
